package mao.thinkinjava.io.serialize;

import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;

/**
 * 序列化的类的静态域并不会被保存，
 * 相当于jvm重新加载那那个类,初值取决于类的初始化过程。
 */
public class CADStateRecover {
    public static void main(String[] args) throws Exception{
        ObjectInputStream in = new ObjectInputStream(new FileInputStream("cadStateStore"));
        List<Shape> shapes =(List<Shape>)in.readObject();
        for (int i = 0; i < 3; i++) {
            shapes.get(i).recoverStaticField(in);
        }
        System.out.println(shapes);

    }
}
